namespace CSharpPro._1021;

public class Demo
{

    public void TestPrint()
    {
        // Father father = new Father();
        // Console.WriteLine(father.id);
        // father.Print();
        // Child child = new Child();
        // Console.WriteLine(child.id);
        // child.Print();
        
        //编译看左，执行看右
        // Father father2 = new Child();
        // father2.Print();
        
        Father father1 = new Father(); 
        Father father2 = new Child();
        Father father3 = new Son();
        father1.Print();
        father2.Print();
        father3.Print();
        
        Console.WriteLine("-------------");
        
        Father father4 = new Father();
        father4.Print();
        Child child = new Child();
        child.Print();
        Son son = new Son();
        son.Print();

        // int int32 = Convert.ToInt32("123");
        // Student student = new Student();
        // student.Id = 1001;
        // student.Name = "张三";
        // Console.WriteLine(student.Name);
        // Student student2 =new Student(id:1002) ;
        // Console.WriteLine(student2.Id);
        // Student student3=new Student(id:1003,name:"李四") ;
        // Console.WriteLine(student3.Name);
        // Console.WriteLine(student3.ToString());
    }

    public int Compare(int a, int b, int c)
    {
        if (a < b && a > c)
        {
            return a;
        }
        else if (b < a && b > c)
        {
            return b;
        }
        else if (c > a && c > b)
        {
            return c;
        }
        else
        {
            return 0;
        }
    }
    
}